package com.gqyin.cloud.ai.demo.service;

import org.springframework.ai.chat.messages.AssistantMessage;
import org.springframework.ai.image.ImageResponse;

import java.util.Map;

/**
 * @author guiqing.yin
 * @Date 2024-05-14 16:21
 */
public interface TongYiService {

    /**
     * Hello World example.
     *
     * @param message conversation content question.
     * @return AI answer.
     */
    String completion(String message);

    /**
     * Stream call.
     *
     * @param message conversation content question.
     * @return AI answer.
     */
    Map<String, String> streamCompletion(String message);

    /**
     * Prompt template.
     *
     * @param adjective params1.
     * @param topic     params2.
     * @return AI answer.
     */
    AssistantMessage genPromptTemplates(String adjective, String topic);

    /**
     * AI role example.
     *
     * @param message question content,
     * @param name    params1.
     * @param voice   params2.
     * @return AI answer.
     */
    AssistantMessage genRole(String message, String name, String voice);

    /**
     * Gen images.
     *
     * @param imagePrompt prompt info.
     * @return {@link ImageResponse}
     */
    ImageResponse genImage(String imagePrompt);

    /**
     * Gen audio.
     *
     * @param text prompt info.
     * @return ByteBuffer object.
     */
    String genAudio(String text);
}
